package com.itchen.web;

import com.itchen.pojo.User;
import com.itchen.service.UserService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author げっしょく
 * @date 2021/9/2
 */
@WebServlet("/inquireUserName")
public class InquireUserName extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        UserService userService = new UserService();
        User user = userService.selectUserName(username);
        if (user != null){

        }else {

        }
        /*if (user == null) {
            User user1 = new User();
            user.setUsername(username);
            user.setPassword(password);

        }*/
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
